﻿<Window x:Class="Vtron.LEDCorrective.ImageWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ImageWindow" Height="600" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Text="图像颜色切换" FontSize="14"/>
            <TextBlock Grid.Row="1" Text="提示：鼠标滚轮可放大缩小，鼠标左键可拖动。"/>
            <StackPanel Orientation="Horizontal"  Grid.Row="2">
                <TextBlock Text="图像颜色："/>
                <RadioButton x:Name="red_RadioButton" GroupName="Color" Margin="5,0,0,0" VerticalAlignment="Center" IsChecked="True" Click="red_RadioButton_Click">红色</RadioButton>
                <RadioButton x:Name="green_RadioButton" GroupName="Color" Margin="5,0,0,0" VerticalAlignment="Center" Click="green_RadioButton_Click">绿色</RadioButton>
                <RadioButton x:Name="blue_RadioButton" GroupName="Color" Margin="5,0,0,0" VerticalAlignment="Center" Click="blue_RadioButton_Click">蓝色</RadioButton>
                <CheckBox Content="拟合成圆" x:Name="fitting_CheckBox" Margin="20,0,0,0" Click="fitting_CheckBox_Click"/>
                <CheckBox Content="二值化" x:Name="thresholdBinary_CheckBox" Margin="20,0,0,0" Click="thresholdBinary_CheckBox_Click"/>
            </StackPanel>

        </Grid>
        <Grid x:Name="ImageComparePanel" Grid.Row="1">
            <Grid.Resources>
                <TransformGroup x:Key="ImageCompareResources">
                    <ScaleTransform />
                    <TranslateTransform/>
                </TransformGroup>
            </Grid.Resources>
            <ContentControl MouseLeftButtonDown="MasterImage_MouseLeftButtonDown" MouseLeftButtonUp="MasterImage_MouseLeftButtonUp" MouseMove="MasterImage_MouseMove" MouseWheel="MasterImage_MouseWheel">
                <Image RenderOptions.BitmapScalingMode="NearestNeighbor" x:Name="MasterImage" Stretch="Uniform" RenderTransform="{StaticResource ImageCompareResources}"/>
            </ContentControl>
        </Grid>
    </Grid>
</Window>

